<?php
/**
 * Created by PhpStorm.
 * User: cape
 * Date: 2017/10/10
 * Time: 13:00
 */

class Base{
    public function sayHello(){
        echo 'Hello';
    }
}

trait SayWorld{
    public function sayHello(){
        parent::sayHello();
        echo 'World!';
    }
}

class MyHelloWorld extends Base{
    use SayWorld;
}

$o = new MyHelloWorld();
$o->sayHello();
























